package cn.cdeden.knowledge.domain.dto;

import cn.cdeden.common.translation.annotation.Translation;
import cn.cdeden.common.translation.constant.TransConstant;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
//import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author GW
* @date 2024-01-19
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysDocLogDto implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 防止精度丢失 */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

//    @ApiModelProperty(value = "操作者")
    private Long operatorId;

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
        setOperatorNickname(operatorId.toString());
    }

    @Translation(type = TransConstant.USER_ID_TO_NICKNAME)
    private String operatorNickname;


    public void setOperatorNickname(String operatorNickname) {
        this.operatorNickname = operatorNickname;
    }

//    @ApiModelProperty(value = "企业文档/团队文档")
    private String documentType;

//    @ApiModelProperty(value = "文档编号")
    private String documentId;

//    @ApiModelProperty(value = "操作类型")
    private String operationType;

//    @ApiModelProperty(value = "文档类型")
    private String documentName;

//    @ApiModelProperty(value = "文档路径")
    private String documentPath;

//    @ApiModelProperty(value = "文档状态")
    private String documentStatus;

//    @ApiModelProperty(value = "创建部门id")
    private Long operatorDept;

    public void setOperatorDept(Long operatorDept) {
        setOperationDeptName(operatorDept.toString());
        this.operatorDept = operatorDept;
    }


    public void setOperationDeptName(String operationDeptName) {
        this.operationDeptName = operationDeptName;
    }

    @Translation(type = TransConstant.DEPT_ID_TO_NAME)
    private String operationDeptName;


//    @ApiModelProperty(value = "拥有者编号")
    private String createId;

//    @ApiModelProperty(value = "创建者")
    private String createBy;

//    @ApiModelProperty(value = "创建日期")
    private Date createTime;

//    @ApiModelProperty(value = "是否有孩子")
    private Boolean isHasChildren = false;
}
